<style type="text/css">
    /*#resourceModal {*/
        /*left:39%*/
    /*}*/
</style>
<h3 class="page-title">经营单位</h3>
<div class="tabbable-custom">
    <div class="portlet">
        <div class="portlet-title">
            <button class="btn btn-success title-action" ng-click="customerGrid.add()"
                    tabindex="0">
                <i class="fa fa-plus"></i> 新增客户
            </button>
            <a href="javascript:void(0);" class="title-operation search-expand">筛选</a>

            <div class="title-search-box">
                <input type="text" placeholder="请输入客户名称" class="search-field"
                       style="width: 180px;" maxlength="100" ng-model="customerGrid.query.quickSearchName">
                <a class="fa fa-search" ng-click="customerGrid.query(customerGrid.query.quickSearch = 1)"></a>
            </div>
        </div>
        <div class="portlet-search-body" style="display: none;">
            <form class="form-inline" role="form">
                <div class="form-group">
                    <div class="col-md-4">
                        <div class="input-icon">
                            <i class="fa fa-user"></i>
                            <input class="form-control" placeholder="客户名称" ng-model="customerGrid.query.customerName">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-4">
                        <div class="input-icon">
                            <i class="fa fa-mobile-phone"></i>
                            <select class="form-control" name="status" ng-model="customerGrid.query.customerType"
                                    style="width: 200px;color: #b3b3b3;"
                                    ng-options="opt.value as opt.name for opt in options.customerType">
                                <option value="">-- 类型 --</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-4">
                        <div class="input-icon">
                            <i class="fa fa-lightbulb-o"></i>
                            <select class="form-control" name="status" ng-model="customerGrid.query.status"
                                    style="width: 200px;color: #b3b3b3;"
                                    ng-options="opt.value as opt.name for opt in options.CUSTOMER_STATUS">
                                <option value="">-- 状态 --</option>
                            </select>
                        </div>
                    </div>
                </div>
                <button class="btn btn-primary" ng-click="customerGrid.query(customerGrid.query.quickSearch = 0)"><i class="fa fa-search"></i> 搜索</button>
                <button class="btn btn-primary" ng-click="customerGrid.reset()">
                    <i class="fa fa-rotate-left"></i> 重置
                </button>
            </form>
        </div>
        <div class="portlet-body" style="width: 100%">
            <table ed-grid="customerGrid" class="table table-striped table-bordered table-hover dataTable"
                   ed-url="customer/query.do" ed-model="customer" style="width: 100%">
                <thead>
                <tr>
                    <th ed-data="_index"></th>
                    <th ed-data="customerName" style="width:150px;">客户名称</th>
                    <th ed-data="customerType | code : 'customerType'" style="width:100px;">客户类型</th>
                    <th ed-data="contacts" style="width:100px;">联系人</th>
                    <th ed-data="contactsPhone" style="width:100px;">联系电话</th>
                    <th ed-data="address">详细地址</th>
                    <th style="width:210px;">操作</th>
                </tr>
                </thead>
            </table>
        </div>
    </div>
</div>

<div ed-modal="customerAddModal" data-options="width:'900px',title: '客户信息编辑', static:true,icon: 'fa-user'">
    <div class="form" style="overflow: auto;height: 500px;">
            <form action="#" class="form-horizontal form-row-seperated w5c-form" w5c-form-validate novalidate name="validateForm">
                <div class="form-body">
                	<div class="row">
                        <div class="col-md-12">
	                        <div class="form-group">
		                        <label class="col-md-2 control-label"><span class="required">*</span>客户名称：</label>
		                        <div class="col-md-4">
		                            <input type="text" class="form-control" name="customerName"
		                                   ng-model="customer.customerName" required>
		                        </div>
		                        <label class="col-md-2 control-label"><span class="required">*</span>客户类型：</label>
				                        <div class="col-md-4">
				                            <select class="form-control" name="customerType" ng-model="customer.customerType"
				                                    ng-options="opt.value as opt.name for opt in options.customerType"
				                                    required></select>
				                        </div>
		                    </div>
                        </div>

                    </div>
                    <div class="row">
                        <div class="col-md-12">
	                        <div class="form-group">
		                        <label class="col-md-2 control-label"><span class="required">*</span>联&nbsp; 系&nbsp;人： </label>
		                        <div class="col-md-4">
		                            <input type="text" class="form-control" name="contacts" ng-model="customer.contacts" required>
		                        </div>
		                        <label class="col-md-2 control-label"><span class="required">*</span>联系电话：</label>

		                        <div class="col-md-4">
		                           <input type="text" class="form-control" name="contactsPhone" ng-model="customer.contactsPhone" ed-validate="mobile" required>
		                        </div>
		                    </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-md-2 control-label" >地　　址 ：</label>
                                <div class="col-md-10">
		                            <textarea type="text" style="width: 80%;" class="form-control" name="address"
                                              ng-model="customer.address"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-12">
	                        <div class="form-group">
		                        <label class="col-md-2 control-label"><span class="required">*</span>营业执照 ：</label>
		                        <div class="col-md-4">
		                             <input type="text" class="form-control" name="businessLicense" ng-model="customer.businessLicense" required>
		                             <div ed-uploader data-options="text:' 文件上传',accept:'image/*'" class="ng-uploader" ng-model="customer.bLFile"></div>
				                     <img id="customerAddModalBLImgViewArea" alt="请上传图片" src="" style="width: 200px;height: 200px;">
		                        </div>
		                        <label class="col-md-2 control-label"><span class="required">*</span>组织机构 ：</label>
		                        <div class="col-md-4">
		                             <input type="text" class="form-control" name="orgCertificate" ng-model="customer.orgCertificate" required>
		                             <div ed-uploader data-options="text:' 文件上传',accept:'image/*'" class="ng-uploader" ng-model="customer.oCFile"></div>
				                     <img id="customerAddModalOCImgViewArea" alt="请上传图片" src="" style="width: 200px;height: 200px;">
		                        </div>
		                    </div>
                        </div>
                    </div>


                     <div class="row">
                        <div class="col-md-12">
	                        <div class="form-group">
		                        <label class="col-md-2 control-label"><span class="required">*</span>税&nbsp; 务&nbsp;证 ：</label>
		                        <div class="col-md-4">
		                            <input type="text" class="form-control" name="taxCertificate" ng-model="customer.taxCertificate" required>
		                            <div ed-uploader data-options="text:' 文件上传',accept:'image/*'" class="ng-uploader" ng-model="customer.tCFile"></div>
				                   	<img id="customerAddModalTCImgViewArea" alt="请上传图片" src="" style="width: 200px;height: 200px;">
		                        </div>
		                    </div>
                        </div>
                    </div>
                </div>
            </form>
    </div>

    <!--<div class="portlet box purple">-->
        <!--<div class="portlet-title">-->
            <!--<div class="caption">-->
                <!--<i class="fa fa-gift"></i>Scrollable Accordions-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="portlet-body">-->
            <!--<div class="panel-group accordion scrollable" id="accordion2">-->
                <!--<div class="panel panel-default">-->
                    <!--<div class="panel-heading">-->
                        <!--<h4 class="panel-title">-->
                            <!--<a class="accordion-toggle accordion-toggle-styled" data-toggle="collapse" data-parent="#accordion3" href="#collapse_3_1">-->
                                <!--Collapsible Group Item #1 </a>-->
                        <!--</h4>-->
                    <!--</div>-->
                    <!--<div id="collapse_3_1" class="panel-collapse in">-->
                        <!--<div class="panel-body">-->
                            <!--<p>-->
                                <!--Duis autem vel eum iriure dolor in hendrerit in vulputate. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod.-->
                            <!--</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="panel panel-default">-->
                    <!--<div class="panel-heading">-->
                        <!--<h4 class="panel-title">-->
                            <!--<a class="accordion-toggle accordion-toggle-styled collapsed" data-toggle="collapse" data-parent="#accordion3" href="#collapse_3_2">-->
                                <!--Collapsible Group Item #2 </a>-->
                        <!--</h4>-->
                    <!--</div>-->
                    <!--<div id="collapse_3_2" class="panel-collapse collapse">-->
                        <!--<div class="panel-body" style="height:200px; overflow-y:auto;">-->
                            <!--<p>-->
                                <!--Duis autem vel eum iriure dolor in hendrerit in vulputate. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--Duis autem vel eum iriure dolor in hendrerit in vulputate. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--<a class="btn blue" href="ui_tabs_accordions_navs.html#collapse_3_2" target="_blank">-->
                                    <!--Activate this section via URL </a>-->
                            <!--</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="panel panel-default">-->
                    <!--<div class="panel-heading">-->
                        <!--<h4 class="panel-title">-->
                            <!--<a class="accordion-toggle accordion-toggle-styled collapsed" data-toggle="collapse" data-parent="#accordion3" href="#collapse_3_3">-->
                                <!--Collapsible Group Item #3 </a>-->
                        <!--</h4>-->
                    <!--</div>-->
                    <!--<div id="collapse_3_3" class="panel-collapse collapse">-->
                        <!--<div class="panel-body">-->
                            <!--<p>-->
                                <!--Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--Duis autem vel eum iriure dolor in hendrerit in vulputate. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--<a class="btn green" href="ui_tabs_accordions_navs.html#collapse_3_3" target="_blank">-->
                                    <!--Activate this section via URL </a>-->
                            <!--</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="panel panel-default">-->
                    <!--<div class="panel-heading">-->
                        <!--<h4 class="panel-title">-->
                            <!--<a class="accordion-toggle accordion-toggle-styled collapsed" data-toggle="collapse" data-parent="#accordion3" href="#collapse_3_4">-->
                                <!--Collapsible Group Item #4 </a>-->
                        <!--</h4>-->
                    <!--</div>-->
                    <!--<div id="collapse_3_4" class="panel-collapse collapse">-->
                        <!--<div class="panel-body">-->
                            <!--<p>-->
                                <!--Duis autem vel eum iriure dolor in hendrerit in vulputate. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--Duis autem vel eum iriure dolor in hendrerit in vulputate. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--<a class="btn red" href="ui_tabs_accordions_navs.html#collapse_3_4" target="_blank">-->
                                    <!--Activate this section via URL </a>-->
                            <!--</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="panel panel-default">-->
                    <!--<div class="panel-heading">-->
                        <!--<h4 class="panel-title">-->
                            <!--<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="javascript:void(0)">-->
                                <!--Collapsible Group Item #1 </a>-->
                        <!--</h4>-->
                    <!--</div>-->
                    <!--<div id="collapse_2_1" class="panel-collapse in">-->
                        <!--<div class="panel-body">-->
                            <!--<p>-->
                                <!--1111-->
                            <!--</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="panel panel-default" ng-repeat="test in testObj">-->
                    <!--<div class="panel-heading">-->
                        <!--<h4 class="panel-title">-->
                            <!--<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="javascript:void(0)" ng-click="clickToggle($event,$index)">-->
                                <!--{{test.name}} </a>-->
                        <!--</h4>-->
                    <!--</div>-->
                    <!--<div ng-class="{true:'panel-collapse in',false:'panel-collapse collapse'}[$index == 0]">-->
                        <!--<div class="panel-body">-->
                            <!--<p>-->
                                <!--Duis autem vel eum iriure dolor in hendrerit in vulputate. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--Duis autem vel eum iriure dolor in hendrerit in vulputate. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut.-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--<a class="btn red" href="ui_tabs_accordions_navs.html#collapse_3_4" target="_blank">-->
                                    <!--Activate this section via URL </a>-->
                            <!--</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->

                <!--<div class="panel panel-default">-->
                    <!--<div class="panel-heading">-->
                        <!--<h4 class="panel-title">-->
                            <!--<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="javascript:void(0)">-->
                                <!--Collapsible Group Item #2 </a>-->
                        <!--</h4>-->
                    <!--</div>-->
                    <!--<div id="collapse_2_2" class="panel-collapse collapse">-->
                        <!--<div class="panel-body">-->
                            <!--<p>-->
                                <!--2222-->
                            <!--</p>-->
                            <!--<p>-->
                                <!--<a class="btn blue" href="ui_tabs_accordions_navs.html#collapse_2_2" target="_blank">-->
                                    <!--Activate this section via URL </a>-->
                            <!--</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="panel panel-default">-->
                    <!--<div class="panel-heading">-->
                        <!--<h4 class="panel-title">-->
                            <!--<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse_2_3">-->
                                <!--Collapsible Group Item #3 </a>-->
                        <!--</h4>-->
                    <!--</div>-->
                    <!--<div id="collapse_2_3" class="panel-collapse collapse">-->
                        <!--<div class="panel-body">-->
                            <!--<p>-->
                                <!--3333-->
                            <!--</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="panel panel-default">-->
                    <!--<div class="panel-heading">-->
                        <!--<h4 class="panel-title">-->
                            <!--<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse_2_4">-->
                                <!--Collapsible Group Item #4 </a>-->
                        <!--</h4>-->
                    <!--</div>-->
                    <!--<div id="collapse_2_4" class="panel-collapse collapse">-->
                        <!--<div class="panel-body">-->
                            <!--<p>-->
                                <!--4444-->
                            <!--</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
    <!--</div>-->
</div>

<div ed-modal="customerContractModal" style="height:500px;min-width:922px;left: 39%" data-options="title: '合同信息', static:true, icon: 'glyphicon glyphicon-briefcase',
                onOkClick : customerContractTrue, onHidden : customerContractCancel" >
    <div class="tabbable-custom">
        <div class="portlet" style="height: 370px">
            <div class="portlet-title">
                <div class="title-search-box">
                    <input type="text" placeholder="合同编号..." class="search-field"
                           style="width: 180px;" maxlength="100" ng-model="resourceGrid.query.contractNo">
                    <a class="fa fa-search" ng-click="resourceGrid.query()"></a>
                </div>
            </div>
            <div class="portlet-body" style="width: 100%" ng-if="showResoModal">
                <table ed-grid="resourceGrid" class="table table-striped table-bordered table-hover dataTable"
                       ed-url="customer/queryContract.do?customerId={{customerId}}" ed-model="contract" style="width: 99.5%;margin-left: 2px;">
                    <thead>
                    <tr>
                        <th ed-data="_index"></th>
                        <th ed-data="contractNo">合同编号</th>
                        <th ed-data="contractTitle">标题</th>
                        <th ed-data="sourceType | code : 'contractSourceType'">合同来源</th>
                        <th ed-data="contractAmount">总金额</th>
                        <th ed-data="contractDate">签订日期</th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</div>


<div ed-modal="resourceDetailsModal" style="left: 54%" data-options="width:'1000px',title: '合同明细', static:true, icon: 'glyphicon glyphicon-briefcase',
                onOkClick : resourceDetailsTrue, onHidden : resourceDetailsCancel" >
    <div class="tabbable-custom">
        <div class="portlet" style="height: 370px">
            <div class="portlet-title">
                <div class="title-search-box">
                    <input type="text" placeholder="名称..." class="search-field"
                           style="width: 180px;" maxlength="100" ng-model="resourceDetailsGrid.query.resourceName">
                    <a class="fa fa-search" ng-click="resourceDetailsGrid.query()"></a>
                </div>
            </div>
            <div class="portlet-body" style="height: 500px;" ng-if="showResDetailsModal">
                <table ed-grid="resourceDetailsGrid" class="table table-striped table-bordered table-hover dataTable"
                       ed-url="contract/queryResource.do?contractId={{contractId}}" ed-model="resourceDetails" style="width: 99.5%;margin-left: 2px;">
                    <thead>
                    <tr>
                        <th ed-data="_index"></th>
                        <th ed-data="resourceCode">编号</th>
                        <th ed-data="resourceName">名称</th>
                        <th ed-data="mediaType | code : 'mediaType'">媒体类型</th>
                        <th ed-data="model">型号</th>
                        <th ed-data="status | code : 'resourceStatus'">状态</th>
                        <th ed-data="startDate">开始日期</th>
                        <th ed-data="endDate">结束日期</th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</div>
<div ed-modal="customerResourceScheduleModal"
	data-options="width:'870px',static:true,title: '客户资源排期明细',
    icon: 'glyphicon glyphicon-briefcase'">
	<div ng-include="'views/customer/customerResource_schedule.html'"
		style="height: 495px;"></div>
</div>

<div ed-modal="customerUserModal" data-options="width:'900px',static:true,title: '账号设置',
    icon: 'glyphicon glyphicon-briefcase'" >
    <div class="form" style="height: 500px">
		<form action="#" class="form-horizontal form-row-seperated w5c-form"
			w5c-form-validate novalidate name="customerUserForm">
			<div class="form-body">
				<div class="row">
					<div class="col-md-12">
						<div class="form-group">
							<label class="col-md-2 control-label">
								经营单位：
							</label>
							<div class="col-md-10">
								<p class='form-control-static'>{{customerUserModal.customer.customerName}}</p>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12">
						<div class="form-group">
							<label class="col-md-2 control-label">
								<span class="required">*</span>登陆账号：
							</label>
							<div class="col-md-10">
								<input style="width: 300px;" type="text" class="form-control" name="userCode"
									ng-model="customerUserModal.user.code" ng-maxlength="20" required>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12">
						<div class="form-group">
							<label class="col-md-2 control-label">
								登陆密码：
							</label>
							<div class="col-md-4">
								<p class='form-control-static'>******</p> 
							</div>
							<div class="col-md-6" ng-show="customerUserModal.user.id">
								<p class='form-control-static'>
									<button type="button"  ng-click="customerUserModal.passwordReset();" class="btn btn-xs btn-success">
										<i class="fa fa-cog"></i> 密码重置
									</button>
								</p> 
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12">
						<div class="form-group">
							<label class="col-md-2 control-label">
								<span class="required">*</span>账号状态：
							</label>
							<div class="col-md-10">
								<select style="width: 300px;" class="form-control" name="userState" ng-model="customerUserModal.user.state"
                                ng-options="opt.value as opt.name for opt in options.userstate" required></select>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12">
						<div class="form-group">
							<label class="col-md-2 control-label">
								账号描述：
							</label>
							<div class="col-md-10">
								<textarea style="width: 300px;" class="form-control" rows="3" ng-model="customerUserModal.user.remark"></textarea>
							</div>
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>


